/**
 * @description: 授权
 */
import { defHttp } from '../http'
import type { CommonAPI } from '../schema/all'
/** 查询授权详情 */
export const getAdminApiLicenseDetailApi: CommonAPI<
  '/admin/api/license',
  'get'
> = (params) => defHttp.get(`/admin/api/license`, { params })

/** 更新授权 */
export const updateAdminApiLicenseApi: CommonAPI<
  '/admin/api/license',
  'put'
> = (data) => defHttp.put(`/admin/api/license`, { data })

/** 创建授权 */
export const addAdminApiLicenseApi: CommonAPI<'/admin/api/license', 'post'> = (
  data
) => defHttp.post(`/admin/api/license`, { data })

/** 删除授权 */
export const deleteAdminApiLicenseApi: CommonAPI<
  '/admin/api/license',
  'delete'
> = (data) => defHttp.delete(`/admin/api/license`, { data })

/** 查询授权概览 */
export const getAdminApiLicenseOverviewApi: CommonAPI<
  '/admin/api/license/overview',
  'get'
> = (params) => defHttp.get(`/admin/api/license/overview`, { params })

/** 解绑授权 */
export const postAdminApiLicenseUnbindApi: CommonAPI<
  '/admin/api/license/unbind',
  'post'
> = (data) => defHttp.post(`/admin/api/license/unbind`, { data })

/** 查询授权列表 */
export const getAdminApiLicensesListApi: CommonAPI<
  '/admin/api/licenses',
  'get'
> = (params) => defHttp.get(`/admin/api/licenses`, { params })

/** 查询授权绑定记录 */
export const getAdminApiLicenseBindRecordsApi: CommonAPI<
  '/admin/api/license/bind-records',
  'get'
> = (params) => defHttp.get(`/admin/api/license/bind-records`, { params })
